var Toolbar = function(){};
Toolbar.init = function(id){
	var T = new Toolbar();
	T.hand = $(id).addClass('toolbar');
    return T;
};
Toolbar.prototype.butEv = {
	'new': function(){w_open(c_U+'-fpost');},
	'edit': function(){var ids = dTA.getSelect_ids();if(ids) w_open(c_U+'-fpost&id='+ids);},
	'del': function(){dTA.delSelect_ids();},
	'refresh': function(){document.location.reload();}
}

// add
Toolbar.prototype.addBut = function(b, f){
	if (!f)
		f = this.butEv[b];
	$('<a>').appendTo(this.hand)
		.append('<span class="icon-32 toolbar-i-'+ b +'"></span><span class="text">'+ language._( 'toolbar-l-'+b) +'</span>')
		.bind('click',{b:b}, f);
	return this;
}
Toolbar.prototype.getBut = function(b){
	var a= this.hand.find('.toolbar-i-'+ b);
	if (a.length>0)
		return a.parent();
}